package com.eastfair.common.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.eastfair.boot.request.PageParams;
import com.eastfair.core.base.R;
import com.eastfair.pay.dto.InvoiceApplyDTO;
import com.eastfair.pay.dto.InvoiceApplyPageQuery;
import com.eastfair.pay.vo.InvoiceApplyVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;


/**
 * <p>
 * 前端控制器
 * 发票申请
 * </p>
 *
 * @author clm
 * @date 2022-06-08
 */
@FeignClient(value = "mice-pay/invoiceApply")
public interface InvoiceApplyFeign {


    /**
     * 发票申请保存
     */
       @PostMapping("/saveInvoiceApply")
      R saveInvoiceApply(@RequestBody InvoiceApplyDTO invoiceApplyDTO);
    /**
     * 发票申请查询
     */
     @PostMapping("/queryList")
     R<Page<InvoiceApplyVO>> queryList(@RequestBody @Validated PageParams<InvoiceApplyPageQuery> params);
    /**
     * 确认开票详情查询
     * @param invoiceApplyId
     * @return
     */
    @GetMapping("invoiceApplyCnfirmQueryById")
     R<InvoiceApplyVO>  invoiceApplyCnfirmQueryById(@RequestParam("invoiceApplyId")Long invoiceApplyId);

    /**
     * 开票详情查询
     * @param invoiceApplyId
     * @return
     */
    @GetMapping("invoiceApplyQueryById")
     R<InvoiceApplyVO>  invoiceApplyQueryById(@RequestParam("invoiceApplyId") @Validated @NotNull(message = "发票ID不能为为空") Long invoiceApplyId);

}
